<template>
  <div class="goods">
    <div
      class="head"
      :style="{
        backgroundImage: 'url(' + msg.s_goods_photos[1].path + ')',
      }"
    >
      <img :src="msg.s_goods_photos[0].path" alt="" />
    </div>
    <div class="content">
      <div class="content-name">{{ msg.name }}</div>
      <p>一英寸影像传感器.5.4k超高清视频.大师</p>
      <div class="content-desc">{{ msg.desc }}</div>
      <div class="content-price">￥{{ msg.price }}</div>
    </div>
    <div class="mask">
      <img :src="msg.s_goods_photos[2].path" alt="" />
    </div>
  </div>
</template>

<script>
export default {
  props: {
    msg: {
      // type :Object,
      default: {},
    },
  },
};
</script>

<style lang="scss" scoped>
.goods {
  color: #000;
  background-color: #fff;
  position: relative;
  width: 390px;
  height: 547px;
  // background-color: blue;
  &:hover {
    cursor: pointer;
  }
  .head {
    width: 100%;
    height: 50%;
    // background-color: pink;
    background-position: top center;
    background-size: contain;
    background-repeat: no-repeat;
    display: flex;
    justify-content: center;
    align-items: center;
    img {
      width: 70%;
    }
  }
  .content {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    .content-name {
      font-family: Microsoft JhengHei;
      text-transform: uppercase;
      height: 40px;
      line-height: 40px;
      font-size: 28px;
      padding: 0 24px;
      color: #3b3e40;
      text-align: center;
      font-weight: 550;
    }
    .content-desc,
    .content-price,
    p {
      margin-top: 16px;
      padding: 0 24px;
      font-size: 14px;
      font-weight: 400;
      line-height: 24px;
      -webkit-line-clamp: 3;
      max-height: 72px;
      text-align: center;
    }
    p {
      font-size: 12px;
    }
    .content-price {
      font-size: 17px;
    }
  }
  .mask {
    position: absolute;
    width: 100%;
    top: 0;
    left: 0;
    background-color: #fff;
    opacity: 0;
    transition: all 0.35s;
    img {
      width: 100%;
      transform-origin: center;
      //   transform: scale(1.1);
    }
  }
  &:hover .mask {
    opacity: 1;
  }
  &:hover {
    box-shadow: 0px 10px 10px -2px #e4e4e4;
  }
}
</style>